package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt");
        String line = "我像只鱼儿在你的荷塘,只为和你守候那皎洁月光";
        byte[] bytes = line.getBytes(StandardCharsets.UTF_8);
        fos.write(bytes);
        fos.write("\r\n".getBytes());
        fos.write("熬过了四季荷花依然香,将你宛在水中央".getBytes());
        fos.close();

 /*       FileOutputStream fis = new FileOutputStream("fos.txt");
        String s = "你打电话我不接啊";
        byte[] bytes = s.getBytes(StandardCharsets.UTF_8);
        fis.write(bytes);
        fis.write("你是不是傻".getBytes(StandardCharsets.UTF_8));
        fis.close();*/
    }
}
